<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>登陆--四川大学科技成果转化平台</title>
		<script src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
		<link rel="stylesheet" href="../css/login.css" />
	</head>
	<body>
	<!-- header顶部标语、登陆注册 -->
	<header>
		<div class="header-top">
			<div class="container">
				<div class="row">
					<div class="header-top-left">
						<div class="welcome-msg"><span>欢迎来到四川大学科技成果交易平台!</span></div>
					</div>
					<div class="header-top-right">
						<ul class="header-links">
                    		<li><a href="http://123.207.115.103:8100/index">首页</a></li>
                    		<li><a href="http://123.207.115.103:8100/about">关于</a></li>
                		</ul>
					</div>
				</div>
			</div>
		</div>
	</header>
	<div class="content">
		<div class="form">
			<div onsubmit="return false" method="post">
				<p class="form-type">账号登陆</p>
				<label>
					<span class="title">用户名:</span>
					<span class="field"><input type="text" name="identifier" id="identifier" value=""></span>
				</label>
				<label>
					<span class="title">密<i style="visibility: hidden;">小</i>码:</span>
					<span class="field"><input type="password" name="credential" id="credential" value=""></span>
				</label>
				<div class="to-login">
					<button type="button" class="style-bottom" id="btn-login">登陆</button>
					<input type="text" value="telephone" name="type" id="type" hidden="hidden" />
				</div>
				<div class="segment"><h5>其他登陆方式</h5></div>
				<div class="third-login">
					<button class="style-bottom" id="btn-wxLogin">微信登陆</button>
				</div>
				<div class="segment"><h5>没有账号？</h5></div>
				<div class="to-register">
					<button class="style-bottom"><a href="/signUp">注册一个平台账号</a></button>
				</div>
			</div>
		</div>
	</div>


	<footer>
		<div class="footer-middle">
			<div class="container">
				<div class="row">
					版权所有：Copyright © 2018 WSN
				</div>
			</div>
		</div>
	</footer>

	<script>

		$("#btn-wxLogin").click(function () {
            location.href="/wxLogin";
        });

        $("#btn-login").click(function () {
            console.log("btn-login click()");
            console.log($("#identifier").val()+","+$("#credential").val()+","+$("#type").val())
            var data={"identifier":$("#identifier").val(),"credential":$("#credential").val(),"type":$("#type").val()};
            console.log(data)
            $.ajax({
                type: 'post',
                url:'login',
                data:data,
                success: function (data) {
                    console.log(data);
                    if("login failure"==data){
                        alert("账号或者密码错误")
                        // $(".alert").html("账号或者密码错误");
                    }else{
                        location.href=data;
                    }
                },
                error: function () {
                }
            });
        });
	</script>
	</body>
</html>
